<table class="table table-hover">
    <thead>
        <tr>
            <th></th>
            <th>发货单号</th>
            <th>发货账号</th>
            <th>站点</th>
            <th>发货国家</th>
            <th>销售</th>
            <th>状态</th>
            <th>物流状态</th>
            <th>异常</th>
            <th style="max-width: 200px;">备注</th>
            <th>发货时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach($paginator as $row)
            <tr>
                <td><input type="checkbox" class="grid-row-checkbox" data-id="{{ $row->id }}" /></td>
                <td>{{ $row->delivery_no }}</td>
                <td>{{ \App\Models\Basics\SysPlatAccount::getAccountById($row->account_id) }}</td>
                <td>{{ \App\Models\Basics\SysArea::getSysAreaById($row->area_id) }}</td>
                <td>{{ \App\Models\Basics\SysCountry::getCountryById($row->country_id) }}</td>
                <td>{{ \App\Util\User::getUsernameById($row->seller_id) }}</td>
                <td>{{ \App\Models\Delivery\FBADelivery::$_status[$row->status] }}</td>
                <td>{{ \App\Models\Delivery\FBADelivery::$_logisticsStatus[$row->logistics_status] }}</td>
                <td>{{ \App\Models\Delivery\FBADelivery::$_exDesc[$row->ex_desc] }}</td>
                <td>
                    @if($row->status < 6)
                        <a class="grid-editable-remarks" href="#" data-type="text"
                           data-pk="{{ $row->id }}"
                           data-url="{{ '/xqc/delivery/fba-ex/'.$row->id }}"
                           data-value="{{ $row->remarks }}">{{ $row->remarks }}</a>
                    @else
                        {{ $row->remarks }}
                    @endif
                </td>
                <td>{{ $row->delivered_at }}</td>
                <td>
                    <a href="/xqc/delivery/fba-ex/{{ $row->id }}" class="btn btn-xs btn-primary">查看</a>
                </td>
            </tr>
        @endforeach
    </tbody>
</table>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('.grid-editable-remarks').editable({"emptytext":"<i class=\"fa fa-pencil\"><\/i>","showbuttons":false,"mode":"inline","name":'remarks'});
        $('.grid-row-checkbox').iCheck({checkboxClass:'icheckbox_minimal-blue'}).on('ifChanged', function () {
            if (this.checked) {
                $(this).closest('tr').css('background-color', '#ffffd5');
            } else {
                $(this).closest('tr').css('background-color', '');
            }
        });
    });
</script>
